<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>

    <script src="./vue.js"></script>
    <script>
      Vue.createApp({
        template: `
          <button @click="fn1">btn1</button>
          <button @click="fn2">btn2</button>
        `,
        methods: {
          fn1: () => {
            console.log(this)
          },
          fn2() {
            console.log(this)
          }
        }
      }).mount('#app')

      // const fn = function() {
      const fn = () => {
        console.log(this)
      }
      fn()

      const obj = { foo: fn }
      obj.foo()
    </script>
  </body>
</html>
